[VB]用鼠标画图

来源:百度知道 编辑:UC知道 时间:2024/05/24 18:57:15
就是在FORM上画 或者PICTURE上画的那个 鼠标经过就画或者鼠标按下的时候 鼠标抬起就停止或者笔的颜色和 背景一样的那个程序。

Private Sub Form_Load()
Me.AutoRedraw = True '这个属性对照From1的属性窗里里有说明
End Sub

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then '当鼠标左建按下时发生
Picture1.PSet (X, Y) 'Picture1画的点为为鼠标按下的点
End If '其他颜色什么的自己加点代码
End Sub